package com.ecoolex.ying.space.enums;

import com.ecoolex.framework.common.EnumInterface;
import com.ecoolex.framework.common.util.Check;
import com.ecoolex.ying.space.entity.EstateProjectActivityGoodsOrder;

public enum EstateProjectActivityGoodsOrderStatus implements EnumInterface<EstateProjectActivityGoodsOrderStatus, Integer>{

	PAID(1,"已付款"),
    REFUNDING(2, "退款中"),
    REFUND(3, "已退款");
    

	private int real;

	private String describe;

	private EstateProjectActivityGoodsOrderStatus(int real, String describe) {
		this.real = real;
		this.describe = describe;
	}

	@Override
	public Integer real() {
		return real;
	}

	@Override
	public String describe() {
		return describe;
	}

	@Override
	public EstateProjectActivityGoodsOrderStatus realOf(Integer real) {
		if (Check.notNull(real)) {
			for (EstateProjectActivityGoodsOrderStatus v : values()) {
				if (v.real().equals(real)) {
					return v;
				}
			}
		}
		return null;
	}
	
	public static boolean canRefund(EstateProjectActivityGoodsOrder order) {
		return PAID.equal(order.getStatus());
	}
}
